package controllers

import (
	"github.com/astaxie/beego"
	"github.com/topaz-h/beego-api/tools"
)

// MainController 结构体
type MainController struct {
	//基于 beego 的 Controller 设计，只需要匿名组合 beego.Controller 就可以
	beego.Controller
}

// Get 重写Get方法
func (m *MainController) Get() {
	//$GOPATH\pkg\mod\github.com\astaxie\beego@v1.12.2\context\context.go
	//$GOPATH\pkg\mod\github.com\astaxie\beego@v1.12.2\context\output.go
	//$GOPATH\pkg\mod\github.com\astaxie\beego@v1.12.2\context\input.go

	//m.Data["Website"] = "beego.me"
	//m.Data["Email"] = "astaxie@gmail.com"
	m.Data["Website"] = "topaz"// 支持结构体、map、切片slice
	m.Data["Email"] = "topazhow@gmail.com"
	m.TplName = "index.tpl"
	tools.LogNotice("NOTICE:\n", "autorender: 自动render,设置为false后TplName不生效\n", "viewspath是模板路径")
}
